mui.ready(function() {
	var  num=1;
		 list();
	function list(){
	mui.ajax('/api/v1/bill/list/money', {
					data: {
						paramStr: "{userName:"+sessionStorage.userName+",token:"+sessionStorage.token+",page:"+num+"}"
					},
					dataType: 'json', 
					type: 'post', 
					timeout: 10000,
					
					success: function(data) {
						if(data.code==200){
							var obj=eval('(' + data.data + ')');
							var ul=document.querySelector(".list")
							var i;
							ul.innerHTML="";
							sessionStorage.page_max=obj.total_page;
							for(i in obj.bills_list){
							
									var li= document.createElement("li"); 
									ul.appendChild(li);
									var div_left = document.createElement("div"); 
									div_left.setAttribute("class", "left"); 
									li.appendChild(div_left);
									
									var p_left= document.createElement("p"); 
									p_left.innerHTML=obj.bills_list[i].create_time;
									div_left.appendChild(p_left);
									var span_left=document.createElement("span");
									span_left.innerHTML=obj.bills_list[i].title;
									div_left.appendChild(span_left);
									
									var div_right = document.createElement("div"); 
									div_right.setAttribute("class", "right"); 
									
									li.appendChild(div_right);
									var p_right= document.createElement("p"); 
									p_right.innerHTML=obj.bills_list[i].money;
									div_right.appendChild(p_right);
								
							}
							
							
							
							
							
						}
		
						
	
					},
					error: function(xhr, type, errorThrown) {
						//异常处理；
						alert("未知错误")
					}
				});
}
		document.querySelector(".next").addEventListener("tap",function(){
			
			if(sessionStorage.page_max<=num){
				alert("真的没有了！");
			}else{
				num=num+1;
				list();
			}
		})
		document.querySelector(".back").addEventListener("tap",function(){
			
			if(num<=1){
				alert("真的没有了！");
			}else{
				num=num-1;
				list();
			}
		})
	
		document.querySelector(".business_cash").addEventListener("tap",function(){
					 mui.openWindow({
					    url: 'check.html', 
					   
					  });
		
		})
	

















})